<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>评论专辑</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f9;
            color: #333;
            margin: 0;
            padding: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
        }

        h2 {
            color: #28a745;
            margin-bottom: 20px;
        }

        form {
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
        }

        label {
            font-weight: bold;
            color: #555;
            display: block;
            margin-bottom: 8px;
        }

        select,
        textarea,
        input[type="number"] {
            width: 100%;
            padding: 10px;
            margin-bottom: 16px;
            border: 1px solid #ccc;
            border-radius: 4px;
            box-sizing: border-box;
            font-size: 14px;
        }

        textarea {
            resize: vertical;
            min-height: 100px;
        }

        button[type="submit"] {
            width: 100%;
            padding: 10px;
            background-color: #28a745;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
        }

        button[type="submit"]:hover {
            background-color: #218838;
        }

        ul {
            list-style-type: none;
            padding: 0;
            margin-bottom: 20px;
        }

        ul li {
            padding: 10px;
            border-radius: 4px;
            margin-bottom: 10px;
            text-align: center;
        }

        .success {
            background-color: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }

        .error {
            background-color: #f8d7da;
            color: #721c24;
            border: 1px solid #f5c6cb;
        }

        .warning {
            background-color: #fff3cd;
            color: #856404;
            border: 1px solid #ffeeba;
        }

        .info {
            background-color: #d1ecf1;
            color: #0c5460;
            border: 1px solid #bee5eb;
        }
    </style>
</head>
<body>
<h2>选择专辑并发表评论</h2>

{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<ul>
    {% for category, message in messages %}
    <li class="{{ category }}">{{ message }}</li>
    {% endfor %}
</ul>
{% endif %}
{% endwith %}

<form method="POST" action="{{ url_for('add_album_review') }}">
    <label for="album_name">专辑选择:</label><br>
    <select id="album_name" name="album_name">
        {% for album in albums %}
        <option value="{{ album[0] }}">{{ album[0] }} - {{ album[1] }}</option>
        {% endfor %}
    </select><br><br>

    <label for="review">评论:</label><br>
    <textarea id="review" name="review" required></textarea><br><br>

    <label for="score">评分:</label><br>
    <input type="number" id="score" name="score" min="1" max="5" required><br><br>

    <button type="submit">提交评论</button>
</form>
</body>
</html>
